home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-05 | 17.1 KB | 589 lines | [TEXT/ttxt] |
- unit PancakeCommon;
- interface
- {$IFC MWerks}
- uses
- Types, Files, Windows, Menus, Memory, Dialogs, Fonts, TextUtils, Packages;
- {$ENDC}
-
- const
- Keypad = 'ABCDEFGHIJKLMNOPRSTUVWXY';
- PossTypeable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()-_+={}[]:;"<,>.?/|\~` ''éå∫ç∂´ƒ©˙^Δ˚¬µøπœ®ß†¨√∑≈¥ΩÅıÇΉÏÌÓÈÔÒ˜ˆØ∏ŒÂÍÊË◊„ÙÁÛ¡™£¢∞§¶•ªº–≠⁄€‹›fifl‡°·‚—±”’“‘ÚÆ…æ≤≥¯˘÷¿»«Ÿ';
- PossPrintable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()-_+={}[]:;"<,>.?/|\~` ''';
- PossUsername = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890';
- PossPhone = '1234567890-';
- MacJmp = $120; {[PTR2LONG]}
- TabEqualsSpace = false;
- InputBufSize = 512;
- ModGeneva = 128;
- IBMCharset = 129;
- BoldIBMCharset = 130;
- Creator = 'Cake';
- UserType = 'User';
- PrefType = 'Pref';
- DataType = 'DATA';
- ExternType = 'XPan';
- TextType = 'TEXT';
- Version = '1.0';
- Null = chr(0);
- EscCode = chr(1);
- ControlC = chr(3);
- BackSpace = chr(8);
- Tab = chr(9);
- Linefeed = chr(10);
- Return = chr(13);
- CntrlX = chr(24);
- Escape = chr(27);
- Destructive = chr(127);
- tooManyNodesErr = -13542;
- MaxNodes = 22; {Normally 22}
- MaxPorts = 3; {Normally 3}
- MaxMenus = 20;
- EditTextStart = 1; {Window Types}
- EditTextEnd = 10;
- UserEdit = 11;
- GroupEdit = 12;
- StringEdit = 13;
- PortPrefs = 14;
- SysPrefs = 15;
- ScreenSaver = 16;
- AboutBox = 17;
- BoardStatus = 18;
- PortStatus = 19;
- Diagnostic = 20;
- MenuEdit = 21;
- NodeStart = 100;
- NodeEnd = NodeStart + MaxNodes;
- ScrollBackLines = 250;
- MaxX = 80;
- MaxY = 24;
- IncX = 6;
- IncY = 11;
- MemBuffer = 61440;
- InitExt = 1;
- Idle = 2;
- KeyPressed = 3;
- DisposeExt = 4;
- DisposeGlobal = 5;
-
- type
- str16 = string[16];
- str8 = string[8];
- systemRec = record
- version, numUsers, numGroups, numCookies, numPorts, logMain, callsToday: integer;
- maxPageCalls, maxPageSegments, maxPageDigits, windowsOpen, validPaths: integer;
- lastCaller, NUP: str16;
- checkNUP, unusedUseMe, speakReason, excuseBefore, sysopAvail, pagingOn, encodeLetters: boolean;
- postLocally: boolean;
- portStatusRect, boardStatusRect: rect;
- pageAcs, netPostAcs: string[25];
- pagerPhone: string[41];
- uucpNode: str16;
- timezone: string[5];
- curDay, curMonth, lastCall: longint;
- organization, newsFrom, domainName: string[59];
- paths: array[1..8] of string[127];
- uucpPort, suckerPort, termPort: integer;
- spoolPath, slurpSpoolPath, mailPath: string[127];
- localPass: str16;
- localProtection, uucpMail: boolean;
- mailService: str16;
- receiveMailAcs, sendMailAcs: string[25];
- seqf: integer;
- mailFrom: string[59];
- saverEnabled: boolean;
- saverIdle: integer;
- checkPopMail, smtpServerEnabled, smtpMail: boolean;
- popServer, smtpRelay: str31;
- uucpKickUsers, strictPhone: boolean;
- uucpLaunchEvery: integer;
- uucpLaunchedLast: longint;
- phoneFormat: str31;
- uucp, uucpFile, parser, term, sucker: FSSpec;
- bbsName: str31;
- suckerKickUsers: boolean;
- suckerLaunchEvery: integer;
- suckerLaunchedLast: longint;
- telnetAcs, fingerOutAcs: string[25];
- pppPort: integer;
- pppEnable, pppOpen, pppClose, pppHard: boolean;
- chatSound, sosSound: str32;
- printAcs, chatAcs, sosAcs: string[25];
- numMenus: integer;
- redirectAcs: string[25];
- passwordsEcho, hotkeyMenuFirst: boolean;
- end;
- asyncWritePtr = ^asyncWriteRec;
- asyncWriteRec = record
- pb: ParamBlockRec;
- nextPtr: asyncWritePtr;
- data: packed array[1..32000] of byte;
- end;
- carrierType = (NoDetection, Bob, CTS, DCDchip, DCDdriver);
- portType = (Serial, TCP, AppleTalk, SysopLocal);
- portSavRec = record
- nodeRect: rect;
- timeout, maxConns: integer;
- connAcs: string[25];
- callSound: str32;
- res: packed array[1..255] of byte;
- case typePort : portType of
- Serial: (
- typeCarrier: CarrierType;
- baud: longint;
- modemDriver, serialPort: integer;
- hwHand, pageable: boolean;
- res1: packed array[1..255] of byte;
- );
- TCP: (
- tcpPort: integer;
- enableFinger: boolean;
- res2: packed array[1..255] of byte;
- );
- AppleTalk: (
- adspName: str32;
- res3: packed array[1..255] of byte;
- );
- end;
- portGlobRec = record
- sessions, openPort, oldStatusLen: integer;
- lastInit: longint;
- connectionLost, inUse: boolean;
- status: string[80];
- case portType of
- Serial: (
- modemSection: (Hangup, InitSerial, PortIsBad, PortIsBusy, Offline, InitModem, GetOk, Awaiting, Answering);
- modemRedirecting: boolean;
- inRefnum, outRefnum: integer;
- inputBuffer: ptr;
- topWritePtr: asyncWritePtr;
- );
- TCP: (
- tcpSection: (InitTCP, GotError, AwaitingOpen, Connecting, CloseConn);
- fingerInSection: (OpenFingerIn, GotFingerErr, WaitingForFinger, NeedName, SendFingerInfo, CloseFingerIn);
- curTcpRefnum, fingerRefnum: integer;
- fingerName: string[80];
- );
- AppleTalk: (
- atlkSection: (InitAtlk, GotAtlkError, AwaitingAtlkOpen, AtlkConnecting, AtlkCloseConn);
- clConnRefnum, curConnRefnum: integer;
- );
- end;
- boardGlobRec = record
- done, screenSaverUp, inBackground, uucpLoaded, termLoaded, pageQueued, localLocked: boolean;
- windowsDirty, menusLocked, lpBeeped, kickingUUCPUsers, kickingSuckerUsers: boolean;
- suckerLoaded, editingPorts: boolean;
- lastResRefnum, strResRefnum, sndResRefnum, txtResRefnum, groupCheck, lpPos: integer;
- groupsStamp, lastIdleMess, gestaltOSAttrResult: longint;
- addedHotkey: str32;
- end;
- displayPtr = ^displayRec;
- displayRec = record
- cx, cy, sx, sy, head, tail, linesSincePause, param, scrollMTop, scrollMBot: integer;
- nodeWind: WindowPtr;
- scroll: ControlHandle;
- lastClick: longint;
- pasteHand: handle;
- cursorRect, selRect: rect;
- params: array[1..5] of byte;
- reversed, blinkOn, inScrollBack, inEsc, questMark: boolean;
- afterEsc: (OpenBracket, OpenParanth, CloseParanth);
- screen: packed array[1..MaxY, 0..MaxX] of byte;
- scrollback: packed array[1..ScrollBackLines, 0..MaxX] of byte;
- end;
- joinRec = record
- groupHash, numRead: longint;
- end;
- joinHand = ^joinPtr;
- joinPtr = ^joinArr;
- joinArr = array[1..32768] of joinRec;
-
- userRecPtr = ^userRec;
- userRec = record
- userName, password: str16;
- shell, localEdit, remoteEdit: str8;
- name, phone: string[32];
- timeOnToday, extraTime, firstLogin, previousLogin, upload, download: longint;
- minsPerDay, userNum: integer;
- accessLevel, priv, linesPerPage: byte;
- male: boolean;
- birthday: longint;
- comment: string;
- emulation: (tty, vt100, ansi, tek, rip);
- checkPop: boolean;
- selGroup: integer;
- res: packed array[1..37] of byte;
- end;
-
- mailIndexRec = record
- loc, len: longint;
- deleted: boolean;
- priv: packed array[1..25] of byte;
- end;
- mailIndexHand = ^mailIndexPtr;
- mailIndexPtr = ^mailIndexArr;
- mailIndexArr = array[1..32768] of mailIndexRec;
-
- shellType = (Waffle, Hotkey, Other);
- nodeActionType = (None, Prompting, Listing, Chatting, LineChatting, Transfering, Editor, Extern, Menu);
- nodeSectionType = (Shell, Logon, NewUser, ListingUsers, Feedback, Mailing, ReadingMail, Chat, Select, Rn, Post, Join, Finger, Telnet, Page, ChangeShell, ChangeEdit, Edit, AreYouSure, Help, Redirect, OneLiner, MultiChat, Download);
- nodeGlobPtr = ^nodeGlobRec;
- nodeGlobRec = record
- display: displayRec;
- keyBuf, userKeyBuf: string;
- curTextHand: Handle;
- nodeAction: nodeActionType;
- yesDefault, critical, nodeClosing, abortListing, pauseEnabled, resolveTextPercents: boolean;
- noReturn, useUserkeyBuf, transInProgress: boolean;
- typeConn: portType;
- lenPrompt, numPrompt, curEditor, curExtern, curNum, lenChat, portNum, connRefnum: integer;
- timesCritical, transRefnum, editRefnum, externRefnum: integer;
- curTextPos, curTextSize, loginTime, lastKeypress, lastBlink, textStart: longint;
- cps, maxPrompt: longint;
- promptProc, quitHandlerProc: ProcPtr;
- thisUser: userRec;
- curPath, curPrompt, curAnswer, curCommand, curParams, shellPrompt, pauseAccepted, interNode: string;
- numParams, curMenu, shellMenu: integer;
- savedNodeAction: array[1..4] of nodeActionType;
- whichShell: ShellType;
- specialPrompt: (Normal, Command, Password, WordWrap);
- shellSection: (InitShell, BeforePrompt, MainPrompt, BeforeGo, GoSection);
- sysopPos, userPos: point;
- savedUseUserKeyBuf, inSlash: boolean;
- joinData: joinHand;
- mailIndex: mailIndexHand;
- curChat, curSysChat: string[80];
- savedVarient: ptr;
- subject: string[80];
- case nodeSection : NodeSectionType of
- Logon: (
- logonSection: (Welcome, NamePrompt, PassPrompt, CheckInfo, LogonFile, CheckBulletins, CheckMail, ToShell);
- lvRefnum, logonIndex: integer;
- lDirID: longint;
- );
- NewUser: (
- newUserSection: (NUPText, NUPPrompt, CheckNup, AccessCode, CheckCode, NewUserText, NewUserName, NewName, NewPhone, NewBirth, NewSex, NewPassword, VerifyPassword, SaveUserInfo);
- question: boolean;
- );
- ListingUsers: (
- curUser: integer;
- loadedUser: userRec;
- );
- Feedback: (
- feedbackSection: (FeedbackText, FeedbackPrompt, SendFeedback);
- );
- Mailing: (
- mailingSection: (ReplyMail, WhoTo, MailSubject, MailEdit, SaveMail);
- curMailing: str16;
- curDomainAddr: string[80];
- );
- ReadingMail: (
- rmSection: (InitRm, RmPrompt, RmProcess, ListRm, CloseRm);
- rmRefnum, numMail, curMail, rmTi: integer;
- );
- Chat: (
- chatSection: (ChatText, ChatYesNo, ReasonPrompt, Beep);
- );
- Select: (
- selectSection: (AskGroup, SelectAction);
- );
- Rn, Post: (
- rnSection: (InitRn, CheckGroup, AskRead, ProcessAnswer, ReadMessage, RnPrompt, RnAction, RnSecond, ListingTitles, InitSearch, Searching, Posting, CatchUp, RnWriting, RnBatchWrite, CloseRn);
- curGroup: integer;
- search: string[40];
- references: string;
- curMess, curPost, rnTli: longint;
- read, searchForward: boolean;
- case integer of
- 1: (
- batchWriteSection: (BWCheck, BWFilenameP, BWInit, PerformBW);
- bwFrom, bwTo: longint;
- );
- 2: (
- postingSection: (PostReply, PostSubject, PostEdit, SavePost);
- postSection: (PostCommandline, GroupAction, InitPost, DoingPost, ClosePost);
- );
- );
- Join: (
- joinSection: (JoinCommandline, InitJoin, ListGroups, ListingGroups, JoinReturn, JoinPrompt, JoinAction, CloseJoin);
- joinGroup, joinNum: integer;
- joining: boolean; {Joining or unjoining?}
- );
- Finger: (
- FingerSection: (InitFinger, ConnFinger, ConnectingFinger, DoingFinger, CloseFinger);
- fingerConn: integer;
- fingerBuf: handle;
- );
- Telnet: (
- TelnetSection: (InitTelnet, ConnTelnet, ConnectingTelnet, DoingTelnet, CloseTelnet);
- teln: record
- conn: integer;
- buf, expectBuf: handle;
- inOption: boolean;
- port, curParam: integer;
- status: longint;
- option: string[2];
- end;
- );
- Page: (
- pageSection: (PageText, PagePrompt, SendPage);
- );
- AreYouSure: (
- sureSection: (AskSure, CheckAndExec);
- sureType: (OffAYS, LoginAYS);
- );
- ChangeShell: (
- changeShellSection: (CSText, ChangeShellPrompt, SetShell);
- );
- ChangeEdit: (
- changeEditSection: (CEText, ChangeEditPrompt, SetEdit);
- );
- Edit: (
- editSection: (InitEdit, CreateFile, OpenFileEdit, EditFile);
- editFileRefnum: integer;
- );
- Help: (
- helpSection: (DispMenu, HelpPrompt, PromptAction);
- helpPath: string[80];
- helpLevel: integer;
- );
- Redirect: (
- redirectSection: (InitRedirect, DoingRedirect, CleanUpRedirect);
- redirectPort: integer;
- lastCntrlX: longint;
- );
- OneLiner: (
- oneLinerSection: (AskNode, CheckNode, AskOneLiner, SendOneLiner);
- oneLinerNode: integer;
- );
- MultiChat: (
- multiChatSection: (InitMulti, ListMultiUsers, MultiPrompt, DoMulti);
- );
- Download: (
- dlSection: (FilePrompt, DoFind, ProtoPrompt, DoDown);
- );
- end;
- userIndexRec = record
- name: str16;
- num: longint;
- end;
- userIndexHand = ^userIndexPtr;
- userIndexPtr = ^userIndexArr;
- userIndexArr = array[1..32768] of userIndexRec;
-
- typeGroupType = (Local, Usenet, Fidonet);
- groupRec = record
- groupName: string[58];
- min, max, lastScan, dirID: longint;
- validBits, vRefnum, hash, keep: integer;
- readAcs, postAcs: string[25];
- typeGroup: typeGroupType;
- anon, new: boolean;
- end;
- groupHand = ^groupPtr;
- groupPtr = ^groupArr;
- groupArr = array[1..32768] of groupRec;
-
- sectionRec = record
- sectionName: string[58];
- lookAcs, dlAcs, ulAcs: string[25];
- free: boolean;
- dirID: longint;
- vRefnum, validityBits: integer;
- res: packed array[1..42] of byte;
- end;
- sectionHand = ^sectionPtr;
- sectionPtr = ^sectionArr;
- sectionArr = array[1..32768] of sectionRec;
-
- commandsRec = record
- hotkey: char;
- slash, enabled: boolean;
- mainMenu: str32;
- acs, description: string[25];
- end;
- commandsArr = array[1..32768] of commandsRec;
- commandsHand = ^commandsPtr;
- commandsPtr = ^commandsArr;
-
- menuRec = record
- menuName: str32;
- menuPrompt: string;
- numCommands: integer;
- commands: commandsHand;
- end;
-
- cookieIndexHand = ^cookieIndexPtr;
- cookieIndexPtr = ^cookieIndexArr;
- cookieIndexArr = array[1..32768] of longint;
-
- modemStrType = (InitStr, ChangeSpeed, HWOn, HWOff, DtrOn, DtrOff, Answer, HangupStr, Quit);
-
- MailQueueHand = ^MailQueuePtr;
- MailQueuePtr = ^MailQueueArr;
- MailTypeType = (STMPClient, STMPServer, POP2);
- MailQueueRec = record
- connRefnum: integer;
- stage: (Opening, Commanding, Reading, Done);
- received: string;
- case mailType : MailTypeType of
- STMPClient: (
- stmpCommand: (Helo, MailCmd, Rcpt, Data, Close);
- mailHand: handle;
- );
- STMPServer: (
- );
- POP2: (
- popCommand: (HeloCmd, ReadCmd, Retr, CloseCmd);
- userName, password: str16;
- count, bytesReceived: longint;
- receiveHand: handle;
- );
- end;
- MailQueueArr = array[1..100] of MailQueueRec;
-
- {Insert All Declerations Here:}
- privatesHand = Handle;
- {End of User Declerations}
-
- editParamsPtr = ^editParamsRec;
- editParamsRec = record
- message: byte;
- nodeGlobs: nodeGlobPtr;
- privates, globals: privatesHand;
- externRefnum, appRefnum: integer;
- reserved: packed array[1..96] of char;
- procs: array[1..25] of ProcPtr;
- end;
-
- const
- Bounces = 1; {Report where consts}
- Callers = 2;
- Schedular = 3;
- Errors = 4;
- Events = 5;
- LogFail = 6;
- Mail = 7;
- Net = 8;
- Transfers = 9;
-
- vCurTextHand = 1;
- vKeyBuf = 2;
- vNodeAction = 3;
- vCurAnswer = 4;
- vCurCommand = 5;
- vCurParams = 6;
- vNumParams = 7;
- vThisUser = 8;
- vNoReturn = 9;
- vCurPath = 10;
- vCx = 11;
- vCy = 12;
-
- type
- ptr2hand = ^Handle;
- ptr2str = ^str255;
- ptr2bool = ^boolean;
-
- procedure WriteProc (str: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure WritelnProc (str: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure WriteHandProc (hand: Handle; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure ListResFileProc (name: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure SetNodeActionProc (action: NodeActionType; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure RestoreNodeActionProc (theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure JumpToProc (x, y: integer; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure OutProc (str: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure OutPtrProc (buf: ptr; size: longint; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure ReportProc (where: integer; str: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- function GetVarPtrProc (which: integer; theRout: ProcPtr): ptr;
- inline
- $205f, $4e90;
-
- procedure ListHandProc (hand: handle; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- function ListTextFileProc (pathname, filename: string; theRout: ProcPtr): OSErr;
- inline
- $205f, $4e90;
-
- procedure LettersPromptProc (prompt, possible: string; len: byte; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure PasswordPromptProc (prompt, possible: string; len: byte; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure NumbersPromptProc (prompt, possible: string; max: longint; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure AutoPromptProc (prompt, possible: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure YesNoPromptProc (prompt: string; yesDefault: boolean; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure DatePromptProc (prompt: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure PhonePromptProc (prompt: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure ClrScrProc (theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- function ReplacePercentsProc (str: string; replaceProc: procPtr; user: userRecPtr; theRout: ProcPtr): string;
- inline
- $205f, $4e90;
-
- function HasAccessProc (acs: string; theRout: ProcPtr): boolean;
- inline
- $205f, $4e90;
-
- procedure SendFileProc (protocol: char; path, filename: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- procedure ReceiveFileProc (protocol: char; path, filename: string; theRout: ProcPtr);
- inline
- $205f, $4e90;
-
- implementation
- end.
-